package nckd.wnqjt.tmc.tda.plugin.form;

import kd.bos.dataentity.entity.LocaleString;
import kd.bos.entity.qing.*;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;

/**
 * @Classname TlemenLargetAmountQingQueryPlugin
 * @Description 大额资金流出
 * @Version 1.0.0
 * @Date 2024/11/25 下午1:54
 * @Created by xiaoxiaopeng
 */
public class TlemenLargetAmountQingQueryPlugin extends AbstractFormPlugin implements IQingDataProvider {
    @Override
    public QingMeta getMeta(String s) {
        String entityKey = "cas_paybill";
        QingMeta meta = new QingMeta();
        EntryEntity entity1 = new EntryEntity();
        entity1.setKey(entityKey);
        entity1.setName(new LocaleString("付款处理"));
        entity1.setPkFieldName("id");
        meta.addEntryEntity(entity1);

        Field column = new Field();
        column.setEntity(entityKey);//字段所属实体key	否
        column.setKey("id");// 字段名(唯一标识)	是
        column.setFieldType(QingFieldType.Int.toNumber()); //数据类型	是
        column.setName(new LocaleString("id")); //字段别名	是
        meta.addColumn(column);

        column = new Field();
        column.setEntity(entityKey);
        column.setKey("outflow");
        column.setFieldType(QingFieldType.Number.toNumber());
        column.setName(new LocaleString("交易金额"));
        meta.addColumn(column);

        column = new Field();
        column.setEntity(entityKey);
        column.setKey("orgName");
        column.setFieldType(QingFieldType.String.toNumber());
        column.setName(new LocaleString("公司名称"));
        meta.addColumn(column);

        column = new Field();
        column.setEntity(entityKey);
        column.setKey("payDate");
        column.setFieldType(QingFieldType.Date.toNumber());
        column.setName(new LocaleString("交易日期"));
        meta.addColumn(column);//payeename

        column = new Field();
        column.setEntity(entityKey);
        column.setKey("payeename");
        column.setFieldType(QingFieldType.String.toNumber());
        column.setName(new LocaleString("交易对手"));
        meta.addColumn(column);//

        column = new Field();
        column.setEntity(entityKey);
        column.setKey("fundflowitem");
        column.setFieldType(QingFieldType.String.toNumber());
        column.setName(new LocaleString("资金用途"));
        meta.addColumn(column);

        column = new Field();
        column.setEntity(entityKey);
        column.setKey("siz");
        column.setFieldType(QingFieldType.Number.toNumber());
        column.setName(new LocaleString("计数字段"));
        meta.addColumn(column);
        return meta;
    }

    @Override
    public QingData getData(String s, int i, int i1) {

        QFilter[] billFilters = null;
        //单据状态=审核
        QFilter statusFilter = new QFilter("billstatus", QCP.equals,"D");
        //结算方式为空
        QFilter settletNumberFilter = new QFilter("settletnumber", QCP.equals," ");
        //付款银行不包含结算中心
        QFilter payerBankFilter = new QFilter("payerbank.name", QCP.not_like,"结算中心");


        return null;
    }
}
